<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <script>
    let obj = {
      a: 'a',
      b: 'b',
      c: 'c'
    }

    //浅拷贝 改变obj时，job会改变
    // let job = obj ;
    // console.log(job);
    // obj.a = 1;
    // console.log(job);

    let obj2 = {};
    for (const key in obj) {
      obj2[key] = obj[key];
    }

    console.log(obj2);
    obj.a = 2;
    console.log(obj2);

  </script>
</body>
</html>